package com.example.common.exception;

import com.example.common.exception.errcode.ErrCode;
import com.example.common.exception.errcode.ErrCodeBase;

public class BizException extends RuntimeException {
    private int code;
    private String msg;

    public BizException(ErrCode errCode) {
        this.code = errCode.getCode();
        this.msg = errCode.getMsg();
    }

    public BizException(String msg) {
        this.code = ErrCodeBase.UNDEFINED_ERROR.getCode();
        this.msg = msg;
    }

    public int getCode() {
        return this.code;
    }

    public String getMsg() {
        return this.msg;
    }
}